Optimal. Leaf size=137 \[ \frac {\tan (c+d x) (3 a A+2 a C+2 b B)}{3 d}+\frac {(4 a B+4 A b+3 b C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\tan (c+d x) \sec (c+d x) (4 a B+4 A b+3 b C)}{8 d}+\frac {(a C+b B) \tan (c+d x) \sec ^2(c+d x)}{3 d}+\frac {b C \tan (c+d x) \sec ^3(c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.180, Rules used = {4076, 4047, 3768, 3770, 4046, 3767, 8} \[ \frac {\tan (c+d x) (3 a A+2 a C+2 b B)}{3 d}+\frac {(4 a B+4 A b+3 b C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\tan (c+d x) \sec (c+d x) (4 a B+4 A b+3 b C)}{8 d}+\frac {(a C+b B) \tan (c+d x) \sec ^2(c+d x)}{3 d}+\frac {b C \tan (c+d x) \sec ^3(c+d x)}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3768
Rule 3770
Rule 4046
Rule 4047
Rule 4076
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+(4 A b+4 a B+3 b C) \sec (c+d x)+4 (b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+4 (b B+a C) \sec ^2(c+d x)\right ) \, dx+\frac {1}{4} (4 A b+4 a B+3 b C) \int \sec ^3(c+d x) \, dx\\ &=\frac {(4 A b+4 a B+3 b C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{3} (3 a A+2 b B+2 a C) \int \sec ^2(c+d x) \, dx+\frac {1}{8} (4 A b+4 a B+3 b C) \int \sec (c+d x) \, dx\\ &=\frac {(4 A b+4 a B+3 b C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(4 A b+4 a B+3 b C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {(3 a A+2 b B+2 a C) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {(4 A b+4 a B+3 b C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(3 a A+2 b B+2 a C) \tan (c+d x)}{3 d}+\frac {(4 A b+4 a B+3 b C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.68, size = 100, normalized size = 0.73 \[ \frac {3 (4 a B+4 A b+3 b C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (8 \left (3 a (A+C)+(a C+b B) \tan ^2(c+d x)+3 b B\right )+3 \sec (c+d x) (4 a B+4 A b+3 b C)+6 b C \sec ^3(c+d x)\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.88, size = 158, normalized size = 1.15 \[ \frac {3 \, {\left (4 \, B a + {\left (4 \, A + 3 \, C\right )} b\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, B a + {\left (4 \, A + 3 \, C\right )} b\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left ({\left (3 \, A + 2 \, C\right )} a + 2 \, B b\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, B a + {\left (4 \, A + 3 \, C\right )} b\right )} \cos \left (d x + c\right )^{2} + 6 \, C b + 8 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.26, size = 428, normalized size = 3.12 \[ \frac {3 \, {\left (4 \, B a + 4 \, A b + 3 \, C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, B a + 4 \, A b + 3 \, C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 72 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 72 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.36, size = 223, normalized size = 1.63 \[ \frac {a A \tan \left (d x +c \right )}{d}+\frac {a B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a C \tan \left (d x +c \right )}{3 d}+\frac {a C \left (\sec ^{2}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{3 d}+\frac {A b \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 b B \tan \left (d x +c \right )}{3 d}+\frac {b B \left (\sec ^{2}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{3 d}+\frac {b C \left (\sec ^{3}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{4 d}+\frac {3 b C \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {3 C b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.37, size = 218, normalized size = 1.59 \[ \frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b - 3 \, C b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, B a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a \tan \left (d x + c\right )}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.72, size = 260, normalized size = 1.90 \[ \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A\,b}{2}+\frac {B\,a}{2}+\frac {3\,C\,b}{8}\right )}{2\,A\,b+2\,B\,a+\frac {3\,C\,b}{2}}\right )\,\left (A\,b+B\,a+\frac {3\,C\,b}{4}\right )}{d}-\frac {\left (2\,A\,a-A\,b-B\,a+2\,B\,b+2\,C\,a-\frac {5\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (A\,b-6\,A\,a+B\,a-\frac {10\,B\,b}{3}-\frac {10\,C\,a}{3}-\frac {3\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (6\,A\,a+A\,b+B\,a+\frac {10\,B\,b}{3}+\frac {10\,C\,a}{3}-\frac {3\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-2\,A\,a-A\,b-B\,a-2\,B\,b-2\,C\,a-\frac {5\,C\,b}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________